package AI.screens
{
	import com.cheezeworld.AI.AISettings;
	import com.cheezeworld.AI.Behaviors.*;
	import com.cheezeworld.entity.*;
	import com.cheezeworld.math.MathUtils;
	import com.cheezeworld.rendering.MovingEntityRenderer;
	import com.cheezeworld.screens.IScreenItem;
	import com.cheezeworld.screens.Root;
	import com.cheezeworld.utils.Input;

	public class HideDemo extends AIDemoScreen
	{
		public function HideDemo(a_parentScreen:IScreenItem=null)
		{
			super(a_parentScreen);
			
			screenLabel = "Hide";
			
			// Create some obstacles
			var obstacles:Array = [];
			var ob:Entity;
			
			ob = _factory.getEntity( "Obstacle", _gameworld );
			ob.radius = 35;
			ob.newPos.Set( Root.WIDTH/2, Root.HEIGHT/2 );
			obstacles.push( ob );
			
			// Create some boids
			
			var boid1:Boid;
			boid1 = _factory.getEntity( "Boid1", _gameworld ) as Boid;
			boid1.steering.addBehavior( new Arrive( Input.instance.worldMousePos, AISettings.arriveFast ) );
			boid1.steering.addBehavior( new ObstacleAvoidance( obstacles ) );			
			_factory.getRenderer( boid1, MovingEntityRenderer );
			
			var boid:Boid;
			boid = _factory.getEntity( "Boid1", _gameworld ) as Boid;
			boid.steering.addBehavior( new Hide( boid1, obstacles, 30 ) );
			boid.steering.addBehavior( new ObstacleAvoidance( obstacles ) );
			boid.newPos.Set( 400, 300 );	
			
		}	
		
	}
}